package com.web.support;

import org.apache.struts.actions.MappingDispatchAction;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class AppContext extends MappingDispatchAction {
	private static WebApplicationContext wcx;
	public WebApplicationContext getWebApplicationContext() {
		if(wcx == null) {
			System.out.println("----------------------------------");
			System.out.println("Create WebApplicationContext.");
			System.out.println("----------------------------------");
			wcx = WebApplicationContextUtils.getRequiredWebApplicationContext(
					getServlet().getServletContext());
		}
		return wcx;
	}
}